package cn.tedu.demo.doy2;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test03 {

    @Test
    public void test01(){
        ApplicationContext ac=new ClassPathXmlApplicationContext("beans.xml");
        Demo demo=(Demo)ac.getBean("demo");
        System.out.println(demo);
        ((ClassPathXmlApplicationContext)ac).close();
    }

    @Test
    public void test02(){
        ApplicationContext ac=new ClassPathXmlApplicationContext("beans.xml");

        Context contest=(Context)ac.getBean("context") ;
        System.out.println(contest);
        ((ClassPathXmlApplicationContext)ac).close();
    }

}
